{% load static from staticfiles %}
<!doctype html>
<html>
<head>
    <meta charset="utf8">
    <title>个人博客</title>
    <meta name="keywords" content=""/>
    <meta name="description" content="主题的个人博客模板，优雅、稳重、大气,低调。"/>
    <link href="{% static 'css/base.css' %}" rel="stylesheet">
    <link href="{% static 'css/index.css' %}" rel="stylesheet">
    <link href="{% static 'bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">
    <script src="{% static 'bootstrap/js/jquery-1.12.4.min.js' %}"></script>
    <script src="{% static 'bootstrap/js/bootstrap.min.js' %}"></script>
    <script src="{% static 'bootstrap/js/jquery-1.12.4.min.js' %}"></script>

</head>
<body bgcolor="#EEE">
<header>
    <div id="logo"></div>
    <nav class="topnav" id="topnav"><a href="{% url 'App:index' %}"><span>首页</span><span class="en">Protal</span></a><a
            href="{% url 'App:aboutme' %}"><span>关于我</span><span class="en">About</span></a>
        <a href="{% url 'App:register' %}"><span>注册</span><span class="en">Learn</span></a>
        {#      在这里判断是否带session#}
        {% if usession %}
            <a href="{% url 'App:login' %}"><span>欢迎:{{ usession }}</span><span class="en">Learn</span></a>
            <a href="{% url 'App:logingout' %}"><span>退出</span><span class="en">Learn</span></a>
        {% else %}
            <a href="{% url 'App:login' %}"><span>登录</span><span class="en">Learn</span></a></nav>
        {% endif %}
</header>
<div class="banner">
    <section class="box">
        <ul class="texts">
            <p>打了死结的青春，捆死一颗苍白绝望的灵魂。</p>
            <p>为自己掘一个坟墓来葬心，红尘一梦，不再追寻。</p>
            <p>加了锁的青春，不会再因谁而推开心门。</p>
        </ul>
        {#      头像#}
        <div class="avatar">
             <img id="previewIMG" src="/static/upload/{{ usession }}.png" style="width: 120px;height: 120px;" >
        </div>
    </section>
</div>
<div class="template">
</div>
<article>
    <h2 class="title_tj">
        <p>文章<span>top10</span></p>
    </h2>
    <div class="bloglist left">
        {% for p in data %}
            <h3>{{ p.title }}</h3>
            <figure><img src="{% static '/images/001.png' %}"></figure>
            <ul>
                <p>{{ p.content }}</p>
                <a title="/" href="/App/makeviews/{{ p.id }}" target="_blank" class="readmore">阅读全文>></a>
            </ul>
            <p class="dateview"><span>{{ p.pub_date }}</span><span>作者：{{ p.user.username }}</span>
                <span>点击量：{{ p.views}}</span></p>

        {% endfor %}
    </div>
    <aside class="right">
        <div class="weather">
            <iframe width="250" scrolling="no" height="60" frameborder="0" allowtransparency="true"
                    src="http://i.tianqi.com/index.php?c=code&id=12&icon=1&num=1"></iframe>
        </div>
        <div class="news">
            <h3>
                <p>分类<span>展示</span></p>
            </h3>
            <ul class="rank">
            <li><a href="{% url 'App:moodlist' 0 %}" title="Column 三栏布局 个人网站模板"
                           target="_blank">全部文章</a></li>
                {% for t in tags %}
                    <li><a href="{% url 'App:moodlist' t.id %}" title="Column 三栏布局 个人网站模板"
                           target="_blank">{{ t.name }}</a></li>
                {% endfor %}
            </ul>
        </div>
    </aside>
</article>

<div class="container-fluid">
    <div class="row">
        <div class="col-md-2"></div>
        <div class="col-md-5">
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    {% if page.has_previous %}
                        <li>
                            <a href="{% url 'App:index1' page.number|add:'-1' %}" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                    {% else %}
                        <li class="disabled">
                            <span href="{% url 'App:index1' page.number|add:'-1' %}" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </span>
                        </li>

                    {% endif %}
                    {% for num in pagerange %}
                        {% ifequal num page.number %}
                            <li class="active"><a href="{% url 'App:index1' num %}">{{ num }}</a></li>
                        {% else %}
                            <li><a href="{% url 'App:index1' num %}">{{ num }}</a></li>
                        {% endifequal %}

                    {% endfor %}
                    {% if page.has_next %}
                        <li>
                            <a href="{% url 'App:index1' page.number|add:'1' %}" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                    {% else %}
                        <li class="disabled">
                                <span href="#" aria-label="Next">
                                    <span aria-hidden="true">&raquo;</span>
                                </span>
                        </li>
                    {% endif %}
                </ul>
            </nav>
        </div>
        <div class="col-md-5"></div>
    </div>
</div>


<footer>


</footer>
</body>
</html>
